<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<!--行内JavaScript-->
<button onclick="alert('hello')">按钮</button>

<!--外部JavaScript-->
<script src=""></script>

<script>

  //JavaScript的书写位置分为：行内式、内部式、外部式
  console.log("行内式JavaScript")

</script>
</body>
</html>